package com.zengqingfa.dubbo.mall.rest;

import com.zengqingfa.dubbo.mall.entity.UserAddress;
import com.zengqingfa.dubbo.mall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @fileName: OrderController
 * @author: zengqf3
 * @date: 2021-4-13 10:53
 * @description:
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 初始化订单，查询用户的所有地址并返回
     * @param userId
     * @return
     */
    @RequestMapping("/initOrder")
    public List<UserAddress> initOrder(String userId) {
        return orderService.initOrder(userId);
    }
}
